package com.xin;

public class OperationFactory {
    private Operation operation;
    public Operation createOpetation(String operate) {
        switch (operate) {
            case "+":
                operation = new AddOperation();
                break;
            case "-":
                operation = new SubOperation();
                break;
            case "*":
                operation = new MulOperation();
                break;
            case "/":
                operation = new DivOperation();
                break;

        }

        return operation;
    }

}
